#include <string>
using namespace std ;
#include <iostream>
#include "abonne.h"
#include <stdlib.h>

Abonne::Abonne()
{
solde = 0;
}

Abonne :: Abonne(string n, string p,int numApl, int CIN, double s)
	{
	nom  = n;
	prenom = p;
	numeroAppel = numApl;
	CIN = CIN;
	solde = s;
	}

Abonne :: ~ Abonne() {}

void Abonne::saisir()
{
	cout <<"Donner nom, prenom, numero d'appel, cin , solde"<<endl;
	cin>>nom>>prenom>>numeroAppel>>CIN>>solde;
}

void Abonne::afficher()
{
	cout <<"Nom:"<<nom<<endl;
	cout <<"Prenom:"<<prenom<<endl;
	cout <<"numero d'appel:"<<numeroAppel<<endl;
	cout <<"cin:"<<CIN<<endl;
	cout <<"votre solde "<<solde<<endl;
}



void Abonne::recharger ()
{
        float valRecharge;
        cout<<"saisissez la valeur à recharger"<<endl;
        cin>>valRecharge;        
        solde = solde + valRecharge;
	cout <<"votre nouveau solde est :"<<solde<<endl;
        
}

bool Abonne::consommer(int nbSeconde, float prMinute)
{
                float valConsomme = nbSeconde * prMinute;
                
     
                        if (solde > valConsomme)
                        {
                                solde = solde - valConsomme;
                                return true;
                        }
                
                        else 
                        {
                        cout <<"Solde Insuffisant"<<endl;
                        return false;
                        }
}


















